//
//  ZYLFindMidelColletionViewCell.m
//  Cartoon
//
//  Created by dllo on 15/7/16.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "ZYLFindMidelColletionViewCell.h"

@implementation ZYLFindMidelColletionViewCell
- (void)dealloc
{
    [_frontCollectionView release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.layout = [[[ZYLFindFrontLayout alloc] init] autorelease];
        self.sigleLayout = [[[ZYLFindFrontSigleLayout alloc] init] autorelease];
        self.frontCollectionView = [[[ZYLFindFrontCollectionView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)] autorelease];
        [self.contentView addSubview:self.frontCollectionView];
    }
    return self;
}

- (void)setModel:(ZYLTopic_listsMixedModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    self.frontCollectionView.model = model;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    if (layoutAttributes.indexPath.item == 1) {
        self.frontCollectionView.collectionViewLayout = self.sigleLayout;
    } else {
        self.frontCollectionView.collectionViewLayout = self.layout;
    }
}
@end
